import React from 'react'
import { useTranslation } from 'react-i18next';
import i18n from '../../i18n/Index'
import { Button } from 'antd';
function Index() {
    const { t, i18n } = useTranslation();
   const qiehuan=()=>{
    i18n.changeLanguage(i18n.language==='zh'?'en':"zh")
   }
  return (
    <div>
      <h1>{t('name')}</h1>
      <Button  onClick={()=>qiehuan()}>{i18n.language==='zh'?'简体中文':"English"}</Button>
    </div>
  )
}

export default Index
